//
//  Fraction.h
//  02-ClassAndObject
//
//  Created by dllo on 16/7/5.
//  Copyright © 2016年 daming. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Fraction : NSObject
/** 定义属性 */
@property (nonatomic, assign) NSInteger numerator;
@property (nonatomic, assign) NSInteger denominator;
/** 自定义初始化 */
- (instancetype)initWithNumerator:(NSInteger)numerator
                      denominator:(NSInteger)denominator;
/** 便利构造器 */
+ (instancetype)fractionNumerator:(NSInteger)numerator
                      denominator:(NSInteger)denominator;
/** 加减乘除 */
- (void)addOfFraction:(Fraction *)frac;
- (void)subtractOfFraction:(Fraction *)frac;
- (void)multiplyOfFraction:(Fraction *)frac;
- (void)divideOfFraction:(Fraction *)frac;
/** 最大公约数 */
- (NSInteger)greatestCommonMeasureOfNumerator:(NSInteger)numerator
                                  denominator:(NSInteger)denominator;
/** 约分 */
- (void)reductionOfFraction;
/** 比较大小 */
- (void)compareFraction:(Fraction *)frac;

@end
